<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
Design by Free CSS Templates
http://www.freecsstemplates.org
Released for free under a Creative Commons Attribution 2.5 License

Name       : Substantial
Description: A two-column, fixed-width design for 1024x768 screen resolutions.
Version    : 1.0
Released   : 20100522

-->
<%@ page import="java.util.*" %>
<%@ page import="Model.Bean.*" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Rendamiento de Inmueble</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="CSS/style.css" rel="stylesheet" type="text/css" media="screen" />
<script src="http://code.jquery.com/jquery-1.7.min.js" type="text/javascript"></script>
<script src="js/jquery-validation-1.9.0/jquery.validate.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="CSS/jquery-ui-1.7.2.custom.css">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js"></script>
<script type="text/javascript">
        /* create an array of days which need to be disabled */
            var disabledDays = ["2-21-2010","2-24-2010","2-27-2010","2-28-2010","3-3-2010","3-17-2010","4-2-2010","4-3-2010","4-4-2010","4-5-2010"];

            /* utility functions */
            function nationalDays(date) {
                var m = date.getMonth(), d = date.getDate(), y = date.getFullYear();
                //console.log('Checking (raw): ' + m + '-' + d + '-' + y);
                for (i = 0; i < disabledDays.length; i++) {
                    if(ArrayContains(disabledDays,(m+1) + '-' + d + '-' + y) || new Date() > date) {
                        //console.log('bad:  ' + (m+1) + '-' + d + '-' + y + ' / ' + disabledDays[i]);
                        return [false];
                    }
                }
                //console.log('good:  ' + (m+1) + '-' + d + '-' + y);
                return [true];
            }
            function noWeekendsOrHolidays(date) {
                var noWeekend = jQuery.datepicker.noWeekends(date);
                return noWeekend[0] ? nationalDays(date) : noWeekend;
            }

            /* taken from mootools */
            function ArrayIndexOf(array,item,from){
                var len = array.length;
                for (var i = (from < 0) ? Math.max(0, len + from) : from || 0; i < len; i++){
                    if (array[i] === item) return i;
                }
                return -1;
            }
            /* taken from mootools */
            function ArrayContains(array,item,from){
                return ArrayIndexOf(array,item,from) != -1;
            }


            /* create datepicker */
            jQuery(document).ready(function() {
                jQuery('#inicioContrato').datepicker({
                    minDate: new Date(2000, 0, 1),
                    maxDate: new Date(2020, 11, 31),
                    dateFormat: 'dd/mm/yy',
                    constrainInput: true,
                    beforeShowDay: noWeekendsOrHolidays
                });
            });

            /* create datepicker */
            jQuery(document).ready(function() {
                jQuery('#fechaLuz').datepicker({
                    minDate: new Date(2000, 0, 1),
                    maxDate: new Date(2020, 11, 31),
                    dateFormat: 'dd/mm/yy',
                    constrainInput: true,
                    beforeShowDay: noWeekendsOrHolidays
                });
            });

            /* create datepicker */
            jQuery(document).ready(function() {
                jQuery('#fechaAgua').datepicker({
                    minDate: new Date(2000, 0, 1),
                    maxDate: new Date(2020, 11, 31),
                    dateFormat: 'dd/mm/yy',
                    constrainInput: true,
                    beforeShowDay: noWeekendsOrHolidays
                });
            });

    </script>
<script type="text/javascript">
    $().ready(function() {
        $("#form").validate();
        
        
    });

    function showStuffFac(id){
        if (document.form.factura.checked){
            document.getElementById(id).style.display='block';
        }else{
            document.getElementById(id).style.display='none';
        }
    }
</script>
</head>
<body>
<div id="header">
	<div id="menu">
		<ul>
                        <li><a href="panelSecretaria.jsp" class="first">Inicio</a></li>
			<li class="current_page_item"><a href="inmuebles">Inmuebles</a></li>
		</ul>
	</div>
	<!-- end #menu -->	
</div>
<!-- end #header -->
<!-- end #header-wrapper -->
<div id="logo">
	<h1><a>Constructora</a></h1>
	<p><em>Millan</em></p>
</div>
<hr />
<!-- end #logo -->
<div id="page">
	<div id="content">
		<div id="content-bgtop">
                    <h1>Rentar Inmueble</h1>
			<div id="content-bgbtm">
                            <form id="form" method="post" action="rentarInmueble" name="form" ENCTYPE="multipart/form-data">
                                    <table>
                                        <tr>
                                            <td>Nombre del Arrendador</td>
                                            <td><input type="text" name="arrendador" class="required" id="arrendador"/></td>
                                        </tr>                                        
                                        <tr>
                                            <td>Copia IFE</td>
                                            <td><input type="file" name="ifeFile" class="required"/></td>
                                        </tr>
                                        <tr>
                                            <td>Factura</td>
                                            <td><input name="factura" type="checkbox" value="factura" id="factura" onchange="showStuffFac('factura');return false;" />
                                                <div id="facturaDiv" style="display:none;">
                                                    Cedula
                                                    <input type="file" name="facturaFile" class="required"/>
                                                </div>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>Contrato de arrendamiento</td>
                                            <td><input type="file" name="contratoFile" class="required"/></td>
                                        </tr>
                                        <tr>
                                            <td>Importe de renta</td>
                                            <td><input type="text" name="importeRenta" id="importeRenta" class="required"/></td>
                                        </tr>
                                        <tr>
                                            <td>Deposito (2 meses de renta)</td>
                                            <td><input type="file" name="depositoFile" class="required"/></td>
                                        </tr>
                                        <tr>
                                            <td>Importe del deposito</td>
                                            <td><input type="text" name="importeDeposito" id="importeDeposito" class="required"/></td>
                                        </tr>
                                        <tr>
                                            <td>Fecha Incio de Contrato</td>
                                            <td>
                                               <input type="text" name="inicioContrato" id="inicioContrato" readonly="readonly" size="12" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>Duracion del contrato</td>
                                            <td>
                                                <select name="duracion" id="duracion">
                                                    <option value="1">1 año</option>
                                                    <option value="2">2 años</option>
                                                </select>
                                            </td>
                                        </tr>                                        
                                        <tr>
                                            <td>Contrato de Luz</td>
                                            <td><input type="file" name="contratoLuzPath" class="required"/></td>
                                        </tr>                          
                                        <tr>
                                            <td>Fecha de corte de Luz</td>
                                            <td>
                                                <input type="text" name="fechaLuz" id="fechaLuz" readonly="readonly" size="12" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>Contrato de Agua</td>
                                            <td><input type="file" name="contratoAguaPath" class="required"/></td>
                                        </tr>
                                        <tr>
                                            <td>Fecha de corte de Agua</td>
                                            <td>
                                                <input type="text" name="fechaAgua" id="fechaAgua" readonly="readonly" size="12" />
                                            </td>
                                        </tr>
                                        
                                    </table>                                    
                                <input type="submit" class="positive" value="Rentar" name="rentar"/>
                            </form>
			</div>
		</div>
	</div>
	<!-- end #content -->
	<div style="clear: both;">&nbsp;</div>
	<!-- end #page -->
	<div id="footer">
		
	</div>
	<!-- end #footer -->
</div>
</body>
</html>

